package cn.hzking.gjmall.dialog;

import android.app.Dialog;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import cn.hzking.gjmall.R;
import cn.hzking.gjmall.activitys.refund.ApplyRefundActivity;


/**
 * Created by Administrator on 2016/7/22.
 */
public class RefundTipDialog extends Dialog {
    Context context;
    public RefundTipDialog(Context context) {
        super(context);
        this.context=context;
    }

    private RefundInterface refundInterface;

    public RefundInterface getRefundInterface() {
        return refundInterface;
    }

    public void setRefundInterface(RefundInterface refundInterface) {
        this.refundInterface = refundInterface;
    }

    public RefundTipDialog(Context context, int themeResId) {
        super(context, themeResId);
        this.context=context;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.dialog_refund);
        init();
    }

    private void init() {
        TextView abandonTv=findViewById(R.id.tv_abandon);
        TextView continueTv=findViewById(R.id.tv_continue);
        abandonTv.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                dismiss();
            }
        });
        continueTv.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                dismiss();
                refundInterface.refund();
            }
        });
    }

    public interface RefundInterface {
        public void refund();
    }
}
